Skip to content

Conversation

@dagwieers
Copy link
Collaborator

By integrating string formattig with the localize() function call we can
make both the translations easier to comprehend, as well as the code
more transparant/readable.

And by using SafeDict() it is also more reliable if arguments do not add up.
When a key is not found the 'template' remains in the string.

@dagwieers dagwieers added the enhancement New feature or request label Jul 15, 2019
@dagwieers dagwieers added this to the v2.1.1 milestone Jul 15, 2019
@dagwieers
Copy link
Collaborator Author

@mediaminister @michaelarnauts @pietje666 I wanted your feedback on this implementation, but since I require it for #385 I am going to merge it now. And we can improve/fix/change this as needed.

By integrating string formattig with the localize() function call we can
make both the translations easier to comprehend, as well as the code
more transparant/readable.

And by using SafeDict() it is also more reliable if arguments do not add up.
When a key is not found the 'template' remains in the string.
@dagwieers dagwieers merged commit fcdd04d into add-ons:master Jul 15, 2019
@michaelarnauts
Copy link
Contributor

I like this verry much. It's actually needed to translate to other languages since you don't know the order of the words.

@mediaminister
Copy link
Collaborator

I am all in favor for more readable code.

@dagwieers dagwieers modified the milestones: v2.1.1, v2.1.2 Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants